import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const CMS: AppRouteRecordRaw = {
  path: '/cms',
  name: 'CmsApp',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: 'menu.cms',
    requiresAuth: true,
    icon: 'icon-book',
    order: 150,
  },
  children: [
    {
      path: 'article',
      name: 'CmsArticleApp',
      component: () => import('@/views/cms/article/index.vue'),
      meta: {
        locale: 'menu.cms.article',
        requiresAuth: true,
      },
    },
    {
      path: 'comment',
      name: 'CmsCommentApp',
      component: () => import('@/views/cms/comment/index.vue'),
      meta: {
        locale: 'menu.cms.comment',
        requiresAuth: true,
      },
    },
    {
      path: 'card',
      name: 'CmsCardApp',
      component: () => import('@/views/cms/card-config/index.vue'),
      meta: {
        locale: 'menu.cms.card',
        requiresAuth: true,
      },
    },
    {
      path: 'editor',
      name: 'CmsArticleEditorApp',
      component: () => import('@/views/cms/article/editor/article-editor.vue'),
      meta: {
        locale: 'menu.cms.editor',
        requiresAuth: true,
        hideInMenu: true,
      },
    },
    {
      path: 'column',
      name: 'CmsColumnApp',
      component: () => import('@/views/cms/column/index.vue'),
      meta: {
        locale: 'menu.cms.column',
        requiresAuth: true,
      },
    },
    {
      path: 'author',
      name: 'CmsAuthorApp',
      component: () => import('@/views/cms/author/index.vue'),
      meta: {
        locale: 'menu.cms.author',
        requiresAuth: true,
      },
    },
  ],
};

export default CMS;
